Skip to content

Conversation

kafai-lam
Copy link

For now, whenever .from_orm or .parse_obj method was called on a SQLModel, it will return SQLModel type only instead of the actually model class.

This PR applies generic TypeVar for those methods to generate a more precise typing.

@maresb
Copy link

maresb commented Dec 8, 2021

Please see also https://github.com/kafai97/sqlmodel/pull/1 which adds the return type to .from_orm.

Add correct return type in from_orm
@kafai-lam
Copy link
Author

kafai-lam commented Dec 9, 2021

@maresb seems the author already resolve the type annotations issue with #173

@maresb
Copy link

maresb commented Dec 9, 2021

Indeed! Thanks for pointing that out. Hopefully there will soon be a release.

@kafai-lam kafai-lam closed this Dec 9, 2021
synodriver pushed a commit to synodriver/sqlmodel that referenced this pull request Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants